package wordprocessing;

import wordprocessing.filters.LineFilter;
import wordprocessing.filters.PageFilter;
import wordprocessing.filters.SinkFilter;
import wordprocessing.filters.SourceFilter;
import wordprocessing.filters.WordFilter;
import wordprocessing.pipes.CharPipe;
import wordprocessing.pipes.LinePipe;
import wordprocessing.pipes.PagePipe;
import wordprocessing.pipes.WordPipe;

/**
 * Main class to start the processing
 * 
 * @author Wetzel & Rusch
 * 
 */
public class Wordprocessing {
	public static void main(String[] args) {
		// Connect all pipes and filters
		SourceFilter<String> source = new SourceFilter<String>(null);
		CharPipe<String> charPipe = new CharPipe<String>(source);
		WordFilter wordFilter = new WordFilter(charPipe);
		WordPipe wordPipe = new WordPipe(wordFilter);
		LineFilter lineFilter = new LineFilter(wordPipe);
		LinePipe linePipe = new LinePipe(lineFilter);
		PageFilter pageFilter = new PageFilter(linePipe);
		PagePipe pagePipe = new PagePipe(pageFilter);
		SinkFilter sink = new SinkFilter(pagePipe, null);
		// invoke the method, which starts a new thread with the active filter
		sink.startThread();

	}
}
